package com.sysware.bean;

import java.util.ArrayList;
import java.util.List;


/**
 * @copyright    : Sysware Technology Co., Ltd
 *
 * 描述：
 * @version     : 1.0 
 * @since       : 2013-3-8下午03:28:02
 * @team	    : 
 * @author      : yangh
*/
public class TreeBean {
	
	private String icon;
	
	private String text;

	private TreeBean parent;
	
	private List<TreeBean> children = null;
	
	public TreeBean(){};
	
	public TreeBean(String text, String icon){
		this.text = text;
		this.icon = icon;
	}
	
	public void addChildren(TreeBean treeBean){
		if(null == children){
			children = new ArrayList<TreeBean>();
		}
		children.add(treeBean);
	}
	
	public List<TreeBean> getChildren(){
		return children;
	}
	
	public boolean hasChildren(){
		return children != null && children.size()>0;
	}
	
	
	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public TreeBean getParent() {
		return parent;
	}

	public void setParent(TreeBean parent) {
		this.parent = parent;
	}
	
}
